import request from '@/utils/request'
export function login (data) {
	return request({
		url: '/login',
		headers: {
			isToken: false,
			repeatSubmit: false
		},
		method: 'post',
		data
	})
}

// 退出方法
export function logout () {
	return request({
		url: '/logout',
		method: 'post'
	})
}
// 获取用户详细信息
export function getInfo () {
	return request({
		url: '/getInfo',
		method: 'get'
	})
}

export function getTableList (query) {
	return request({
		url: '/orderCounter/detailList',
		method: 'get',
		params: query
	})
}

export function listCounterOrderFlowDetail (data) {
	return request({
		url: 'counterOrder/listCounterOrderFlowDetail',
		method: 'post',
		data
	})
}
export function getProductGift () {
	return request({
		url: '/productGift/listForPad',
		method: 'get'
	})
}
export function addCounterOrderFlowDetail (data) {
	return request({
		url: 'counterOrder/addCounterOrderFlowDetail',
		method: 'post',
		data
	})
}
// 单品类型
export function getProductTypeList () {
	return request({
		url: '/productType/allList',
		method: 'get'
	})
}
export function getProductList (query) {
	return request({
		url: '/product/listForPad',
		method: 'get',
		query
	})
}
export function getPackageList (query) {
	return request({
		url: '/productPackage/listForPad',
		method: 'get',
		query
	})
}

export function clearShoppingCar (data) {
	return request({
		url: 'counterOrder/clearShoppingCar',
		method: 'post',
		data
	})
}
export function completePayment (data) {
	return request({
		url: 'counterOrder/completePayment',
		method: 'post',
		data
	})
}
// 开台
export function openStage (id, customerId) {
	return request({
		url: `/orderCounter/openStage/${id}/${customerId}`,
		method: 'get'
	})
}
export function giveUpStage (query) {
	return request({
		url: '/counterOrder/release',
		method: 'get',
		params: query
	})
}
// 获取所有客户
export function getAllCustomerList (query) {
	return request({
		url: '/sysCustomer/allList',
		method: 'get',
		params: query
	})
}
